import request from './request'

// 获取订单列表
export const getOrderList = (params) => {
  return request({
    url: '/admin/orders',
    method: 'get',
    params
  })
}

// 获取订单详情
export const getOrderDetail = (id) => {
  return request({
    url: `/admin/orders/${id}`,
    method: 'get'
  })
}

// 删除订单（仅限已取消/已退款订单）
export const deleteOrder = (id) => {
  return request({
    url: `/admin/orders/${id}`,
    method: 'delete'
  })
}

// 修改订单状态
export const updateOrderStatus = (id, data) => {
  return request({
    url: `/admin/orders/${id}/status`,
    method: 'put',
    data
  })
}

// 获取订单统计数据
export const getOrderStatistics = (params) => {
  return request({
    url: '/admin/orders/statistics',
    method: 'get',
    params
  })
}


